package com.zhanglijie.theory.future.futureandtask;


import java.util.concurrent.Callable;

import com.zhanglijie.theory.future.Product;
import com.zhanglijie.theory.future.RealProduct;

/**
 * @author zhanglijie
 * @version 1.0
 * @since 1.1.0 2022/8/14 0014 23:52
 */
public class Server {
    public Product request(int count,char c){
        System.out.println("####开始请求了 count is "+count+" c is "+c);
        FutureProduct futureProduct = new FutureProduct(new Callable<RealProduct>() {
            @Override
            public RealProduct call() throws Exception {
                return new RealProduct(count,c);
            }
        });
        new Thread(futureProduct).start();
        System.out.println("######结束请求了 count is "+count+" c is "+c);
        return futureProduct;
    }
}
